package edu.java.texbooks.scjp.threads.test11;

public class CounterClass implements Runnable {
	private static final int COUNTER = 31;
	private static final int TIME_INTERVAL = 1000;

	@Override
	public void run() {
		for (int i = 1; i < COUNTER; i++) {
			if (i % 10 == 0) {
				System.out.println("The current number is: " + i);
			}

			try {
				System.out.println("Number: " + i);
				Thread.sleep(TIME_INTERVAL);
			} catch (InterruptedException ie) {
				System.out.println("Current "
						+ Thread.currentThread().getName() + "is interrupted");
			}
		}
	}

}
